package com.mingdong.first.mingling.commond;

import com.mingdong.first.mingling.device.Stereo;

public class StereoVolAdd implements Commond {

	Stereo stereo;
	
	public StereoVolAdd(Stereo stereo){
		
		this.stereo = stereo;
	}
	
	
	public void execute() {
		
		int vol = stereo.getVol();
		if(vol < 11){
			stereo.setVol(++vol);
		}
		
	}

	public void undo() {

		int vol = stereo.getVol();
		if(vol > 0){
			stereo.setVol(--vol);
		}
	}

}
